home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18194 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: tekram.com.tw!not-for-mail
  2. From: stkuo@tekram.com.tw (Shih Tung Kuo)
  3. Newsgroups: comp.lang.c++
  4. Subject: VB and DLL program
  5. Date: 19 Apr 1996 10:58:15 +0800
  6. Organization: I need to put my ORGANIZATION here.
  7. Message-ID: <4l6vg7$3mq@tekram.com.tw>
  8. NNTP-Posting-Host: tekram.hinet.net
  9. NNTP-Posting-User: stkuo
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12.  
  13. Dear sir :
  14.  
  15.     We have an application that is programmed using VB3 and calls a lot of
  16. DLL programmed using VC++. This application will work in the Novell Network.  
  17. Now, we have a problem when we call a function in DLL from VB3. The following
  18. is the fragment of our DLL function :
  19.  
  20.         :
  21.         :
  22.     int EXPORT_API NPInitialize(InitHandle ** userHandle, unsigned long uID)
  23.     {
  24.     *userHandle = NULL;
  25.     InitHandle *localHandle = new InitHandle;
  26.     if (!localHandle)
  27.         return ERROR_CODE(NPER_OUT_OF_MEMORY);
  28.         :
  29.         :
  30.     }
  31.  
  32. When we call the function NPInitialize() from VB3, it generates a GERNERAL 
  33. PROTECTION FAULT message when it executes the following statement :
  34.  
  35.     InitHandle *localHandle = new InitHandle;
  36.     
  37. If we trace the program in assembly mode, this problem is occurred in a function
  38. called ??2@ZAPEXI@Z. I think this funtion is the run-time function of "new".
  39.  
  40. How can we solve this problem? Does it produce by VB? Does the VB program 
  41. corruped the heap of the C++ code? We will appreciate your help. Please send 
  42. your solution by sending to our E-mail address. Our E-mail address is
  43. stkuo@tekram.com.tw. 
  44.  
  45.  
  46. Thanks a lot.
  47.  
  48. KUO
  49.  
  50.  
  51.